package com.htht.smartschool.util.config;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.htht.smartschool.util.log.ConsoleLog;
import com.htht.smartschool.util.log.ILog;
import com.htht.smartschool.util.system.DateUtil;

/***
 * 系统配置信息
 * 
 * @author David
 * 
 */
public class SystemConfig {
	
	  public static boolean isDebug = false;
	  
	  public static ILog log=new ConsoleLog();

	  public static Map<String, String> params = new HashMap<String, String>();
	  
	  public static String defaultDateHMSFromat = "yyyy-MM-dd HH:mm:ss";

	  public static String getParam(String name)
	  {
	    String value = "";
	    if (params.containsKey(name))
	      value = (String)params.get(name);
	    if (value == null) {
	      value = "";
	    }
	    return value;
	  }
	  public static void addParam(String name, String value) {
	    params.put(name, value);
	  }

	  public static void printlog(String log)
	  {
//	    String content = DateUtil.getString(System.currentTimeMillis(), DateUtil.defaultDateHMSFromat) + ":" + log;

	    String content = DateUtil.getFormatDate(System.currentTimeMillis()) +":"+log;
//	    System.out.println(content);
	  }
	  
	  public static String getString(long tm, String format) {
		    String s = "";
		    try {
		      Date dt = new Date(tm);
		      SimpleDateFormat sdf = new SimpleDateFormat(format);
		      s = sdf.format(dt);
		    }
		    catch (Exception localException) {
		    }
		    return s;
	  }

}
